const path =require("path")
const HtmlWebpackPlugin=require('html-webpack-plugin');
module.exports ={
    entry:path.join(__dirname,'src/main.js'),
    output:{
        filename:"bundle.js",
        path:path.join(__dirname,"dist")
    },
    module:{
        rules:[
            {
                test:/\.css$/,use:['style-loader','css-loader']
            },
            {

                test:/\.(gif|jpg|png|svg|jpeg)$/,
                use:[
                    {
                        loader:'url-loader',
                        options:{
                            limit:1024
                        }
                    }
                ]
            }
        ]
    },
    plugins:[new HtmlWebpackPlugin({
        template:path.join(__dirname,'pubilc/index.html')
    })],
    mode:"development",
    devServer:{
        static:{
            directory:path.join(__dirname,'public')
        },
        port:8000,
        compress:true
    }
}